#ifndef WRITER_H
#define WRITER_H

#include <QMutex>
#include <QList>
#include <QRunnable>
#include <QThread>
#include "Library.h"

class Writer : public QThread, public QRunnable
{
	Q_OBJECT
	int writingTime;
	int editTime;
	Library *library;

	QList<int> myBooks;

	static QMutex mutex;

	int id;
	static int counter;

public:
	explicit Writer(int writingTime, int editTime, Library *library, QObject *parent = 0);
	void run();
	void write();
	void edit();
	bool tryToReserveSlot();
	void writeBook();
	void editBook();
	
signals:
	
public slots:
	
};

#endif // WRITER_H
